package mediator;

/**
 * @Author liangliangzhao
 * @data 2023/4/19 12:15
 */

public class ClientTest {
    public static void main(String[] args) {
        //创建一个中介者对象
        Mediator mediator = new ConcreteMediator();
        //创建Alarm 并且加入到ConcreteMediator 对象的HashMap
        Alarm alarm = new Alarm(mediator, "alarm");
        //创建了CoffeeMachine对象，并且加入到ConcreteMediator 对象的HashMap
        CoffeeMachine coffeeMachine = new CoffeeMachine(mediator, "coffeeMachine");
        //创建 Curtains , 并且加入到ConcreteMediator 对象的HashMap
        Curtains curtains = new Curtains(mediator, "curtains");
        TV tV = new TV(mediator, "TV");
        //让闹钟发出消息
        alarm.SendAlarm(0);
        coffeeMachine.FinishCoffee();
        alarm.SendAlarm(1);
    }
}
